//
//  ProfileViewController.m
//  SmartWatch
//
//  Created by janshky on 2022/11/18.
//

#import "ProfileViewController.h"
#import "ProfileInfoViewController.h"
#import "HealthReportViewController.h"
#import "MyAttentionViewController.h"
#import "AllQuestionViewController.h"
#import "AboutViewController.h"
#import "SettingViewController.h"

@interface ProfileViewController ()
@property(nonatomic,strong) UIView *topRightView;
@property(nonatomic,strong) UILabel *versionLabel;
@end

@implementation ProfileViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.isHideNavigationBar = YES;
    
    FlexFrameView *flexView = [[FlexFrameView alloc] initWithFlex:@"ProfileViewController" Frame:self.view.bounds Owner:self];
    [self.view addSubview:flexView];
    [flexView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_safeAreaLayoutGuideLeft);
        make.right.equalTo(self.view.mas_safeAreaLayoutGuideRight);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setGradientLayerForTopContainer) name:FLEXDIDLAYOUT object:nil];
    
    self.versionLabel.text = [[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleShortVersionString"];
}

- (void) setGradientLayerForTopContainer{
    self.topRightView.backgroundColor = UIColorMakeWithRGBA(255, 255, 255, 0.35);
    self.topRightView.layer.cornerRadius = 16.0;
    self.topRightView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
}

- (void)profileClick {
    [self.navigationController qmui_pushViewController:[ProfileInfoViewController new] animated:YES completion:nil];
}

- (void)reportClick {
    [self.navigationController qmui_pushViewController:[HealthReportViewController new] animated:YES completion:nil];
}

- (void)attentionClick {
    [self.navigationController qmui_pushViewController:[MyAttentionViewController new] animated:YES completion:nil];
}

- (void)questionClick {
    
    [self.navigationController qmui_pushViewController:[AllQuestionViewController new] animated:YES completion:nil];
}

- (void)aboutClick {
    [self.navigationController qmui_pushViewController:[AboutViewController new] animated:YES completion:nil];
}

- (void)settingClick {
    [self.navigationController qmui_pushViewController:[SettingViewController new] animated:YES completion:nil];
}

@end
